package com.heifeng.cloudshelf.network;


import com.heifeng.cloudshelf.base.BaseResponse;
import com.heifeng.cloudshelf.dao.AdvertisingBaen;
import com.heifeng.cloudshelf.dao.BlueprintInfoBean;
import com.heifeng.cloudshelf.dao.LoginBean;
import com.heifeng.cloudshelf.dao.ProductBean;
import com.heifeng.cloudshelf.dao.ProgrammeBean;
import com.heifeng.cloudshelf.dao.ProgrammeDetailBean;
import com.heifeng.cloudshelf.dao.ProgrammeImageBean;
import com.heifeng.cloudshelf.dao.Programmes3DBean;
import com.heifeng.cloudshelf.dao.SearchDetailBean;
import com.heifeng.cloudshelf.dao.SearchHomeBean;
import com.heifeng.cloudshelf.dao.ShowBean;
import com.heifeng.cloudshelf.dao.ShowHouseBean;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * Created by admin on 2019/8/19.
 */

public interface NetApi {

    @GET("cloud/portal/sendSmsCaptcha")
    Observable<BaseResponse> getLoginCode(@Query("phone") String telephone);

    @GET("cloud/portal/logout")
    Observable<BaseResponse> toLoginOut(@Query("cliId") String cliId, @Query("token") String token);

    @GET("cloud/portal/content")
    Observable<BaseResponse<AdvertisingBaen>> toGetAdvertising();

    @FormUrlEncoded
    @POST("cloud/portal/login")
    Observable<BaseResponse<LoginBean>> toLogin(@Field("phone") String telephone, @Field("captcha") String code, @Field("devid") String device);

    @POST("cloud/productDaquan/getPlanContentList")
    Observable<BaseResponse<ProductBean>> toGetAllProduct();

    @FormUrlEncoded
    @POST("cloud/productDaquan/product/getSpecList")
    Observable<BaseResponse<ProgrammeBean>> getSpecList(@Field("templateId") int templateId);

    @FormUrlEncoded
    @POST("cloud/productDaquan/product/searchBySpecOption")
    Observable<BaseResponse<ProgrammeImageBean>> toSearchBySpecOption(@FieldMap Map<String, Object> map);

    @FormUrlEncoded
    @POST("cloud/productDaquan/product/detail/getProductionInfo")
    Observable<BaseResponse<ProgrammeDetailBean>> getProductionInfo(@Field("productionInfoId") int productionInfoId);

    @FormUrlEncoded
    @POST("cloud/searchNearby/searchCommunityList")
    Observable<BaseResponse<SearchHomeBean>> toSearchCommunityList(@FieldMap Map<String, Object> map);

    @FormUrlEncoded
    @POST("cloud/searchNearby/getHouseTypeByCommunityId")
    Observable<BaseResponse<ShowHouseBean>> getHouseTypeByCommunityId(@FieldMap Map<String, Object> map);

    @FormUrlEncoded
    @POST("cloud/searchNearby/houseType/detail/getHouseTypeInfo")
    Observable<BaseResponse<SearchDetailBean>> getHouseTypeInfo(@Field("houseTypeId") String houseTypeId);

    @FormUrlEncoded
    @POST("cloud/blueprintShow/getBlueprintList")
    Observable<BaseResponse<ShowBean>> getBlueprintList(@Field("pageNo") String pageNo, @Field("pageSize") String pageSize);

    @FormUrlEncoded
    @POST("cloud/blueprintShow/detail/getBlueprintInfo")
    Observable<BaseResponse<BlueprintInfoBean>> getBlueprintInfo(@Field("blueprintId") String blueprintId);

    @GET("/cloud/portal/version/getVersionUpdateInfo")
    Observable<BaseResponse> getVersionUpdateInfo();

    @POST
    @FormUrlEncoded
//    @POST("program/getTableModelHouse")
    Observable<BaseResponse<Programmes3DBean>> getTableModelHouse(@Url String url, @FieldMap Map<String, Object> map);

    //    @GET("program/getTableModel")
    @GET
    Observable<BaseResponse> getTableModel(@Url String url, @Query("id") String id, @Query("openid") String openid);


}
